package com.gqb.thread.join;

public class test {
	public static int a=0;
	public static int b=0;
	public static int c=0;
	
	public static void main(String[] args) throws Exception {
		
	
	    Thread t = new Thread(new Runnable() {
			
			@Override
			public void run() {
				for (int i = 0; i < 5; i++) {
					a+=1;
				}
				
			}
		});  
	    Thread t1 = new Thread(new Runnable() {
			
			@Override
			public void run() {
				for (int i = 0; i < 5; i++) {
					b+=1;
				}
				
			}
		});    
	    Thread t2 = new Thread(new Runnable() {
			
			@Override
			public void run() {
				for (int i = 0; i < 5; i++) {
					c+=1;
				}
				
			}
		});   
	    t.start();
	    t1.start();
	    t2.start();
	    t.join();
	    t1.join();
	    System.out.println(111111);
	    System.out.println(a+","+b+","+c);
	    t2.join();
	    System.out.println(a+","+b+","+c);
	}
	
}
